<?php 
if(isset($beforeText))
{
	echo $beforeText;
}
App::import('Xml');
$parsed_xml =& new XML($feedUrl);
$parsed_xml = Set::reverse($parsed_xml);
if(!is_array($parsed_xml['Rss']['Channel']['Item']))
{
	echo "Error parsing feed";
}
else { ?>
<ul>
<?php 
//$feedItems
	for($i = 0; $i<$feedItems; $i++)
	{ $item = $parsed_xml['Rss']['Channel']['Item'][$i];
		?>
		<li><a href="<?php echo $item['link'];?>"><?php echo $item['title'];?></a></li>
	<?php  } } ?>
</ul>
<?php 
if(isset($afterText))
{
	echo $afterText;
}
?>